-
Notifications
You must be signed in to change notification settings - Fork 779
support export cached_dataset #4992
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
support export cached_dataset #4992
Conversation
/gemini review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces functionality to export and use pre-processed, cached datasets, which is a valuable feature for accelerating development and training workflows. The implementation includes new arguments, an export script, and updates to the training pipeline to handle these cached datasets. The associated refactoring of argument handling and dataset preparation logic improves the overall code structure. The changes are well-implemented and consistent. I have one suggestion to improve code readability in the new ExportCachedDataset
class.
args: args_class | ||
|
||
def __init__(self, args: Union[List[str], ExportArguments, None] = None) -> None: | ||
super(SwiftSft, self).__init__(args) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The use of super(SwiftSft, self)
bypasses the SwiftSft
parent's __init__
to call SwiftPipeline.__init__
. While functional, this is not idiomatic in Python 3 and can be confusing. For better readability, it's recommended to call the grandparent's __init__
explicitly. This makes the intent of skipping the direct parent's initializer clear. You'll need to add from swift.llm import SwiftPipeline
to your imports.
super(SwiftSft, self).__init__(args) | |
from swift.llm import SwiftPipeline | |
SwiftPipeline.__init__(self, args) |
No description provided.